// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 2008-7-11 22:39:06
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   Config.java

package com.creawor.imei.config;

import java.io.PrintStream;
import java.util.HashMap;
import java.util.Properties;

import org.apache.log4j.Logger;

import com.creawor.hz_market.servlet.LoadMapInfoAjax;

public class Config
{
	private static final Logger logger = Logger.getLogger(LoadMapInfoAjax.class);
    public static Config instance()
    {
        if(instance == null)
            instance = new Config();
        return instance;
    }

    private Config()
    {
    }

    public static void setHashMap(HashMap hm)
    {
        openPropertyFile(hm);
    }

    private static void openPropertyFile(HashMap hm)
    {
        String project_name_ = (String)hm.get("PROJECT_NAME");
        String home_name_ = (String)hm.get("HOME_NAME");
        String time_format_ = (String)hm.get("TIME_FORMAT");
        String time_format_sql_ = (String)hm.get("TIME_FORMAT_SQL");
        String date_format_ = (String)hm.get("DATE_FORMAT");
        String date_format_sql_ = (String)hm.get("DATE_FORMAT_SQL");
        String date_format_long_ = (String)hm.get("DATE_FORMAT_LONG");
        String date_format_long_sql_ = (String)hm.get("DATE_FORMAT_LONG_SQL");
        String start_time_ = (String)hm.get("START_TIME");
        String end_time_ = (String)hm.get("END_TIME");
        String slot_time_ = (String)hm.get("SLOT_TIME");
        String rows_on_page_ = (String)hm.get("ROWS_ON_PAGE");
        String filesize_ = (String)hm.get("filesize");
        String imgsize_ = (String)hm.get("imgsize");
        String freepage_ = (String)hm.get("freepage");
        String admin_ = (String)hm.get("admin");
        try
        {
            if(project_name_ != null)
                project_name = project_name_.trim();
            if(time_format_ != null)
                time_format = time_format_;
            if(time_format_sql_ != null)
                time_format_sql = time_format_sql_;
            if(date_format_ != null)
                date_format = date_format_;
            if(date_format_sql_ != null)
                date_format_sql = date_format_sql_;
            if(date_format_long_ != null)
                date_format_long = date_format_long_;
            if(date_format_long_sql_ != null)
                date_format_long_sql = date_format_long_sql_;
            if(start_time_ != null)
                start_time = start_time_;
            if(end_time_ != null)
                end_time = end_time_;
            if(slot_time_ != null)
                slot_time = slot_time_;
            if(rows_on_page_ != null)
                rows_on_page = rows_on_page_;
            if(filesize_ != null)
                filesize = filesize_;
            if(imgsize_ != null)
                imgsize = imgsize_;
            if(admin_ != null)
                admin = admin_;
            if(freepage != null)
                freepage = freepage_;
        }
        catch(Exception e)
        {
            logger.debug((new StringBuilder("[com...pubprocess.RBSConfig] get RBSConfigXML property Error:")).append(e.getMessage()).toString());
        	//System.out.println((new StringBuilder("[com...pubprocess.RBSConfig] get RBSConfigXML property Error:")).append(e.getMessage()).toString());
        }
    }

    public static String getFileSeparator()
    {
        Properties pro = System.getProperties();
        String file_separator = (String)pro.get("file.separator");
        fileSeparator = file_separator;
        return fileSeparator;
    }

    public static String getTime_format()
    {
        return time_format;
    }

    public static String getStart_time()
    {
        return start_time;
    }

    public static String getEnd_time()
    {
        return end_time;
    }

    public static String getSlot_time()
    {
        return slot_time;
    }

    public static String getRows_on_page()
    {
        return rows_on_page;
    }

    public static String getSeparateBetween()
    {
        return separateBetween;
    }

    public static String getSeparateMiddle()
    {
        return separateMiddle;
    }

    public static String getDate_format()
    {
        return date_format;
    }

    public static String getDate_format_long()
    {
        return date_format_long;
    }

    public static String getProject_name()
    {
        return project_name;
    }

    public static String getDate_format_long_sql()
    {
        return date_format_long_sql;
    }

    public static String getDate_format_sql()
    {
        return date_format_sql;
    }

    public static String getAdmin()
    {
        return admin;
    }

    public static String getFilesize()
    {
        return filesize;
    }

    public static String getFreepage()
    {
        return freepage;
    }

    public static String getImgsize()
    {
        return imgsize;
    }

    public static void setAdmin(String string)
    {
        admin = string;
    }

    public static void setFilesize(String string)
    {
        filesize = string;
    }

    public static void setFreepage(String string)
    {
        freepage = string;
    }

    public static void setImgsize(String string)
    {
        imgsize = string;
    }

    private static String project_name = "com.creawor.hzmarket";
    private static String time_format = "HH:mm";
    private static String time_format_sql = "HH24:mm";
    private static String date_format = "dd/MM/yyyy";
    private static String date_format_sql = "dd/mm/yyyy";
    private static String date_format_long = "dd/MM/yyyy HH:mm";
    private static String date_format_long_sql = "dd/mm/yyyy hh24:mi";
    private static String start_time = "8:00";
    private static String end_time = "22:00";
    private static String slot_time = "30";
    private static String rows_on_page = "10";
    private static String separateBetween = ",";
    private static String separateMiddle = "-";
    private static String filesize = "";
    private static String imgsize = "";
    private static String freepage = "";
    private static String admin = "";
    private static String fileSeparator = "\\";
    public static final String CONFIG_FILE_NAME = "hzmarket-Config.xml";
    private static Config instance = null;

}